package com.sina.finance.api.sdk;

public class RequestParametersHolder {
    private ApiHashMap protocalMustParams = new ApiHashMap();
    private ApiHashMap protocalOptParams = new ApiHashMap();;
    private ApiHashMap applicationParams = new ApiHashMap();;

    public void addProtocalMustParams(String key, String value) {
        this.protocalMustParams.put(key, value);
    }

    public ApiHashMap getProtocalMustParams() {
        return this.protocalMustParams;
    }

    public void setProtocalMustParams(ApiHashMap paramRopHashMap) {
        this.protocalMustParams = paramRopHashMap;
    }

    public ApiHashMap getProtocalOptParams() {
        return this.protocalOptParams;
    }

    public void setProtocalOptParams(ApiHashMap paramRopHashMap) {
        this.protocalOptParams = paramRopHashMap;
    }

    public void addProtocalOptParams(String key, String value) {
        this.protocalOptParams.put(key, value);
    }

    public void addApplicationOptParams(String key, String value) {
        this.applicationParams.put(key, value);
    }

    public ApiHashMap getApplicationParams() {
        return this.applicationParams;
    }

    public void setApplicationParams(ApiHashMap paramRopHashMap) {
        this.applicationParams = paramRopHashMap;
    }


    /**
     * 框架协议相关的参数作为url的一部分
     * @return
     */
    public String getSerializedParams() {
        StringBuilder builder = null;
        builder = new StringBuilder();
        builder.append(WebUtils.buildQuery(this.protocalMustParams, "UTF-8"));
        builder.append("&");
        builder.append(WebUtils.buildQuery(this.protocalOptParams, "UTF-8"));
        return builder.toString();
    }

}

